﻿/******************************************************************
** 文 件 名: BD_Project_View.aspx.cs
** Copyright (c) 2010-2012 Honestysoft (GuangZhou) Co.,LTD
** 创 建 人: 蔡少鹏
** 创建日期: 2012-3-7 18:19:15
** 描    述: 基础资料-项目信息查看页面
** 版    本: 2.0.0.0
** 修改描述:
** 修 改 人:
** 修改日期:
******************************************************************/
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Honestysoft.BaseObject;
using Honestysoft.Baseframework.WebUI;
using Honestysoft.Financing.Model;


namespace Honestysoft.Financing.WebUI.Module.Project
{
	public partial class BD_Project_View : BasePage
	{	
		protected override void Page_Load(object sender, EventArgs e)
        {
			base.Page_Load(sender, e);
            if (!IsPostBack)
            {
                Bind();
            }
        }		
		/// <summary>
        /// 绑定页面
        /// </summary>
        private void Bind()
        {
           	BD_Project obj = new BaseBusinessLogic<BD_Project>().GetEntity(Request.QueryString["ID"]);
			if(obj == null){ return; }
			_ID = obj.ID;
			_Code = obj.Code;
			_SN = obj.SN;
			_FCode = obj.FCode;
			_ProjectCategory = Honestysoft.DictionaryHelper.DictionaryInstance.GetDictionaryText(obj.ProjectCategory);
			_Name = obj.Name;
			_ShortName = obj.ShortName;
			_OfficialNo = obj.OfficialNo;
			_IsSplit = ScriptHelper.Image.GetBooleanImage(obj.IsSplit);
			
            //_Owner971 = obj.Owner971;
            //_Owner = obj.Owner;

            string[] arrId = new string[] { obj.Owner971, obj.Owner };
            DataTable dtComp = new Honestysoft.Financing.BusinessLogic.Reports(Globals.CurrentConnStringName).GetCompanyName(arrId);
            DataRow[] rows = null;
            rows = dtComp.Select("ID='" + obj.Owner971 + "'");
            if (rows != null && rows.Length == 1)
            {
                _Owner971 = rows[0]["CompName"].ToString();
            }
            rows = dtComp.Select("ID='" + obj.Owner + "'");
            if (rows != null && rows.Length == 1)
            {
                _Owner = rows[0]["CompName"].ToString();
            }

			_DOwner = obj.DOwner;
			_ConType = Honestysoft.EnumHelper.EnumInstance.GetEnumDataText(typeof(EnumItem.ConType), obj.ConType);
			_PlanStart = obj.PlanStart.HasValue ? obj.PlanStart.Value.ToString("yyyy-MM-dd") : "";
			_PlanEnd = obj.PlanEnd.HasValue ? obj.PlanEnd.Value.ToString("yyyy-MM-dd") : "";
			_StartDate = obj.StartDate.HasValue ? obj.StartDate.Value.ToString("yyyy-MM-dd") : "";
			_EndDate = obj.EndDate.HasValue ? obj.EndDate.Value.ToString("yyyy-MM-dd") : "";
            _ProjectPhase = Honestysoft.EnumHelper.EnumInstance.GetEnumDataText(typeof(EnumItem.ProjectPhase), obj.ProjectPhase);
			_Contact = obj.Contact;
			_ContactPhone = obj.ContactPhone;
			_Progress = obj.Progress;
			_Scale = obj.Scale;
			_Content = obj.Content;
			_Infor = obj.Infor;
			_Overview = obj.Overview;
			_Problems = obj.Problems;
			_Remark = obj.Remark;
			_FinInvestment = obj.FinInvestment.ToString("0.00");
            _Stage = obj.Stage.ToString("0.00");
            _Investment = obj.Investment.ToString("0.00");
            _InvestmentType = Honestysoft.EnumHelper.EnumInstance.GetEnumDataText(typeof(EnumItem.InvestmentType), obj.InvestmentType);
            _TotalCapitalAmount = obj.TotalCapitalAmount.ToString("0.00");
            //_GkLoanAmount = obj.GkLoanAmount.ToString("0.00");
            //_ProjectLoanAmount = obj.ProjectLoanAmount.ToString("0.00");
            //_PlanAmount = obj.PlanAmount.ToString("0.00");
			_SortCode = obj.SortCode.ToString();
            _IsDySplit = ScriptHelper.Image.GetBooleanImage(obj.IsDymSplit);
        }
		
		/// <summary>
        /// 标识
        /// </summary>
		protected string _ID = "";
		/// <summary>
        /// 项目代码
        /// </summary>
		protected string _Code = "";
		/// <summary>
        /// 编号
        /// </summary>
		protected string _SN = "";
		/// <summary>
        /// F项目号
        /// </summary>
		protected string _FCode = "";
		/// <summary>
        /// 项目类别
        /// </summary>
		protected string _ProjectCategory = "";
		/// <summary>
        /// 项目名称
        /// </summary>
		protected string _Name = "";
		/// <summary>
        /// 项目简称
        /// </summary>
		protected string _ShortName = "";
		/// <summary>
        /// 项目文号
        /// </summary>
		protected string _OfficialNo = "";
		/// <summary>
        /// 是否属于拆分项目
        /// </summary>
		protected string _IsSplit = "";
		/// <summary>
        /// 项目单位
        /// </summary>
		protected string _Owner971 = "";
		/// <summary>
        /// 建设单位
        /// </summary>
		protected string _Owner = "";
		/// <summary>
        /// 代建单位
        /// </summary>
		protected string _DOwner = "";
		/// <summary>
        /// 建设性质
        /// </summary>
		protected string _ConType = "";
		/// <summary>
        /// 计划开工日期
        /// </summary>
		protected string _PlanStart = "";
		/// <summary>
        /// 计划竣工日期
        /// </summary>
		protected string _PlanEnd = "";
		/// <summary>
        /// 实际开工日期
        /// </summary>
		protected string _StartDate = "";
		/// <summary>
        /// 预计竣工日期
        /// </summary>
		protected string _EndDate = "";
		/// <summary>
        /// 项目阶段
        /// </summary>
		protected string _ProjectPhase = "";
		/// <summary>
        /// 联系人
        /// </summary>
		protected string _Contact = "";
		/// <summary>
        /// 联系人电话
        /// </summary>
		protected string _ContactPhone = "";
		/// <summary>
        /// 工程进展
        /// </summary>
		protected string _Progress = "";
		/// <summary>
        /// 建设规模
        /// </summary>
		protected string _Scale = "";
		/// <summary>
        /// 主要建设内容
        /// </summary>
		protected string _Content = "";
		/// <summary>
        /// 工程信息
        /// </summary>
		protected string _Infor = "";
		/// <summary>
        /// 工程概况
        /// </summary>
		protected string _Overview = "";
		/// <summary>
        /// 存在问题
        /// </summary>
		protected string _Problems = "";
		/// <summary>
        /// 备注
        /// </summary>
		protected string _Remark = "";
		/// <summary>
        /// 本项目2010年及以前财政累计安排投资（以971号文件为准）
        /// </summary>
		protected string _FinInvestment = "";
		/// <summary>
        /// 前期拨付资金
        /// </summary>
		protected string _Stage = "";
		/// <summary>
        /// 总投资
        /// </summary>
		protected string _Investment = "";
		/// <summary>
        /// 总投资类型
        /// </summary>
		protected string _InvestmentType = "";
		/// <summary>
        /// 资本金到位金额
        /// </summary>
		protected string _TotalCapitalAmount = "";
		/// <summary>
        /// 国开行贷款额度
        /// </summary>
		protected string _GkLoanAmount = "";
		/// <summary>
        /// 项目贷款额度
        /// </summary>
		protected string _ProjectLoanAmount = "";
		/// <summary>
        /// 投资计划
        /// </summary>
		protected string _PlanAmount = "";
		/// <summary>
        /// 排序号
        /// </summary>
		protected string _SortCode = "";

        protected string _IsDySplit = "";
	}
}